package com.dream.keigezhushou.Activity.pop;

import android.content.Context;
import android.view.View;
import android.widget.Button;

import com.dream.keigezhushou.R;


/**
 * Created by mxmf-001 on 17/3/6.
 */

public class AlertDialog extends DialogBase {
    private Button btnOk;
    private Button btnNo;
    private ItemClickListener itemClickListener;

    /**
     * @param contentView
     * @param context
     * @param width
     * @param height
     */
    public AlertDialog(View contentView, final Context context, int width, int height) {
        super(contentView, context, width, height);

        this.context = context;
        btnOk = (Button) contentView.findViewById(R.id.btnOk);
        btnNo = (Button) contentView.findViewById(R.id.btnNo);
        btnOk.setText("确定");
        btnNo.setText("删除");
        btnOk.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(itemClickListener!=null){
                    itemClickListener.onClick();

                }


                dismiss();
            }
        });
        btnNo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

//                Toast.makeText(context, "取消", Toast.LENGTH_SHORT).show();
                dismiss();
            }
        });




}



    public void setItemListener(ItemClickListener itemClickListener) {

        this.itemClickListener = itemClickListener;
    }
public interface ItemClickListener {

    public void onClick();


}
}
